//
//  CTMessageLogic.h
//  ConstellationTalk_0.1
//
//  Created by riley on 15/6/10.
//  Copyright (c) 2015年 riley chu. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "CTMessageItems.h"

typedef enum {
    CTMessageLogicTypePersonal = 1,
    CTMessageLogicTypeOfficial
}CTMessageLogicType;

typedef enum {
    CTMessageLogicTemporaryTypePersonal = 1,
    CTMessageLogicTemporaryTypeOfficical,
    CTMessageLogicTemporaryTypeALL
    
}CTMessageLogicTemporaryType;


typedef void (^requestSuccessBlock) ();
typedef void (^requestFailedBlock) ();

@protocol CTMessageLogicDelegate;


@interface CTMessageLogic : NSObject

//请求
-(void)messageListRequest:(CTRequestMessageListItem *)item
successCompletionHandler:(requestSuccessBlock)successBlock
           failedHandler:(requestFailedBlock)failedBlock;


-(void)messageDeleteRequest:(CTRequestMessageDeleteItem *)item
 successCompletionHandler:(requestSuccessBlock)successBlock
            failedHandler:(requestFailedBlock)failedBlock;


-(void)messageSwitchRequest:(CTRequestMessageSwitchItem *)item
   successCompletionHandler:(requestSuccessBlock)successBlock
              failedHandler:(requestFailedBlock)failedBlock;

//消息列表的数据库操作

//增 
-(void)addMessageData:(NSDictionary *)info;

//删
-(void)deleteMessageData:(CTMessageLogicType)type
            withNoticeID:(NSString *)noticeID;


//清空数据
-(void)clearAllMessageData:(CTMessageLogicType)type;


///////用于提醒显示
//增临时数据
-(void)addTemporaryMessageData:(NSDictionary *)info;

//删临时数据
-(void)deleteTemporaryMessageData:(CTMessageLogicTemporaryType)type;

//获取临时数据的数量
-(NSInteger)mesgTemporaryDataCount:(CTMessageLogicTemporaryType)type;


@property(nonatomic,assign)id<CTMessageLogicDelegate>delegate;

@end


@protocol CTMessageLogicDelegate <NSObject>

-(void)personalMessageReceiveSuccessed;
-(void)personalMessageReceiveFailed;
-(void)personalMessageRemoveSuccessed;


-(void)officialMessageReceiveSuccessed;
-(void)officialMessageRemoveSuccessed;

-(void)clearMessageScuueed:(CTMessageLogicType)type;


-(void)mesgTemporaryAdded;
-(void)mesgTemporaryRemoved;


@end
